loadSort = function(intUserId, intSort) {
	var intPage = $('#page').val();
	var intPage = 1;	
	
	$.getJSON(				
		HOST_VFRIEND + 'ajax/friend?uid='+intUserId+'&page='+intPage+'&sort='+intSort+'&callback=?',		
		function(response) {					
			var msg	= response['msg'];
			if(response['error'] == 0) {
				var intOff		= parseInt(response['offset']);
				var intTotal	= parseInt(response['total']);
				var intLimit	= parseInt(response['limit'])
				$('#relationOfFriend').html('');
				$('#relationOfFriend').html(msg);
				$('#page').val(response['page']);
				if(intOff >= intTotal - intLimit) {
					$('.loadMore').hide();
				} else {
					$('.loadMore').show();
				}
			} else {
				alert(msg);
			}
		}
	);
}
loadMore = function(intUserId) {
	var intPage = $('#page').val();
	var intPage = parseInt(intPage) + 1;
	var intSort	= $('#sort').val();
	$.getJSON(				
		HOST_VFRIEND + 'ajax/friend?uid='+intUserId+'&page='+intPage+'&sort='+intSort+'&callback=?',		
		function(response) {					
			var msg	= response['msg'];
			if(response['error'] == 0) {
				var intOff		= parseInt(response['offset']);
				var intTotal	= parseInt(response['total']);
				var intLimit	= parseInt(response['limit'])
				var strHtml 	= $('#relationOfFriend').html();
				strHtml			= strHtml + msg;
				$('#relationOfFriend').html(strHtml);
				$('#page').val(response['page']);
				if(intOff >= intTotal - intLimit) {
					$('.loadMore').hide();
				}
			} else {
				alert(msg);
			}
		}
	);
}
relationOfFriend = function(intUserId) {
	$.getJSON(				
		HOST_VFRIEND + 'ajax/uifriend?uid='+intUserId+'&callback=?',		
		function(response) {					
			var msg	= response['msg'];
			if(response['error'] == 0) {				
				$.blockUI({
					message: msg, 
					css: { 
						textAlgin:'left',
						background:'none',
						border: 'none',
						width:'400px', 
						top: (($(window).height()-400)/2) + 'px', 
						left:(($(window).width()-400)/2) + 'px',
						cursor: 'default'
					},
					overlayCSS: {
						cursor: 'default'
					}					
				});
				$('#scrollPane').jScrollPane();		
			} else {
				alert(msg);
			}
		}
	);
}